import { Message} from 'element-ui'

// 取出缓存
const GetStore = name => {
	if (!name) return;
	var value = window.sessionStorage.getItem(name);
    if (value !== null) {
        try {
            value = JSON.parse(value);
        } catch (e) {
            value = value;
        }
    }
    return value;
}
// 成功消息
const Success =(message)=> {
  Message({
    message,
    type: 'success',
    duration: 2 * 1000
  })
}
// 失败
const Error =(message)=> {
  Message({
    message,
    type: 'error',
    duration: 2 * 1000
  })
}
export default {
  Success,
  GetStore,
  Error
}
